package com.huaxonline.boot.mybatisplus.provider;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Component;

/**
 * 默认当前用户提供者
 * 当系统未实现自定义 CurrentUserProvider 时使用
 *
 * @author system
 * @since 1.0.0
 */
@Component
@ConditionalOnMissingBean(CurrentUserProvider.class)
public class DefaultCurrentUserProvider implements CurrentUserProvider {

    @Override
    public String getCurrentUsername() {
        // 默认返回系统用户
        return "system";
    }
}

